package com.amazon.shop.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;


/**
 * 创建时间：16:32 2021/2/26
 *
 * @author lzj
 * @since JDK 1.8.0_171
 * 类说明：
 * <p>
 * Modification History:
 * Date         Author          Version            Description
 * ---------------------------------------------------------*
 */
@Component
public class SpringStartMethed implements ApplicationRunner {

    @Value(value = "${ip-intercept}")
    private String CHINA_IP_PATH;

    @Autowired
    private ChinaIPRecognizer chinaIPRecognizer;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        this.ChinaIPRecognizer();
    }

    public void ChinaIPRecognizer() {
        chinaIPRecognizer.loadIPLong(CHINA_IP_PATH);
    }
}
